<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table{
            width: 500px;
            height: 150px;
            background-color: rgb(241, 241, 174);
            margin-top: 10px;
            border-collapse: collapse;
        }
        td{
            border: 1px dashed;
        }
    </style>
    <script>
        function countTotal(){
            alert("input类型节点总数是："+document.getElementsByTagName("input").length);
        }
        function anchorElement(){
            alert("按钮的value是："+document.getElementById("ss").value)
        }
    </script>
</head>
<body>
    <table>
        <form action="" name="form1" method="post">
            <tr>
                <td width="20%">&emsp;用户名</td>
                <td width="80%">&emsp;<input type="text" name="input1" value=""></td>
            </tr>
            <tr>
                <td>&emsp;密码</td>
                <td>&emsp;<input type="password" name="password1" value=""></td>
            </tr>
            <tr>
                <td>&emsp;</td>
                <td>&emsp;<input type="submit" id="ss" name="submit" value="来自大神的提交"></td>
            </tr>
        </form>
    </table>
    <a href="javascript:void(0);" onclick="countTotal();">统计input子节点的总数</a>
    <a href="javascript:void(0);" onclick="anchorElement();">获取提交按钮内容</a>

</body>
</html>